package io;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectStreamClass;
import reflection.JarUtils;

/**
 *
 * @author Ibai
 */
public class ObjectInputStream extends java.io.ObjectInputStream {

    /**
     * {@inheritDoc}
     */
    public ObjectInputStream(InputStream in) throws IOException {
        super(in);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
        //return super.resolveClass(desc);
        String name = desc.getName();
        return Class.forName(name, false, JarUtils.getClassLoader());
    }
}
